﻿#include "StatisticsTable.h"
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QHeaderView>

#pragma execution_character_set("utf-8")

StatisticsTable::StatisticsTable(QWidget *parent)
    : QWidget{parent}
{
    setupUi();
    initConnection();
}

void StatisticsTable::setupUi()
{
    tblView = new QTableView();
    model = new StatisticsTableModel();
    tblView->setModel(model);
    tblView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    tblView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
    tblView->setEditTriggers(QAbstractItemView::NoEditTriggers);
    tblView->verticalHeader()->setSectionResizeMode(QHeaderView::Stretch);
    QVBoxLayout* vLayout = new QVBoxLayout();
    this->setLayout(vLayout);
    vLayout->addWidget(tblView); 
}

void StatisticsTable::initConnection()
{
    connect(model, &QAbstractItemModel::dataChanged, this, [&](){
    });

}

